.class public Lcom/nemustech/regina/RGWorkspace;
.super Lcom/nemustech/tiffany/world/TFPlaceHolder;
.source "RGWorkspace.java"


# static fields
.field private static ELEMENT_BITMAP:Z = false

.field private static final LOG_FLAG:Z = false

.field private static final SWING_EFFECT_COUNT:I = 0x2

.field public static final SWING_EFFECT_DISTANCE:F = 0.3f

.field private static final SWING_EFFECT_DURATION:I = 0x32

.field private static final SWING_EFFECT_POSITION:I = 0x2

.field private static final SWING_EFFECT_START_DIRECTION:I = 0x1

.field private static final SWING_EFFECT_STEP_COUNT:I = 0x2

.field private static final SWING_EFFECT_TICK:I = 0xa

.field private static TAG:Ljava/lang/String; = null

.field public static final THUMB_SHRINK_RATIO:F = 0.5f


# instance fields
.field private mBackgroundPanel:Lcom/nemustech/regina/WallpaperPanel;

.field private mBackgroundThumbPanel:Lcom/nemustech/regina/WallpaperPanel;

.field private mElementArrList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/nemustech/regina/Element;",
            ">;"
        }
    .end annotation
.end field

.field private mElementPanel:Lcom/nemustech/tiffany/world/TFPanel;

.field private mHandler:Landroid/os/Handler;

.field private mJitImageProvider:Lcom/nemustech/tiffany/world/TFModel$JitImageProvider;

.field private mMiniature:Lcom/nemustech/tiffany/world/TFPlaceHolder;

.field private mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

.field private mPaused:Z

.field private mPendingEvent:Ljava/util/LinkedHashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/LinkedHashMap",
            "<",
            "Ljava/lang/Long;",
            "Ljava/lang/Runnable;",
            ">;"
        }
    .end annotation
.end field

.field private mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

.field private mRequestUpdate:Z

.field private mWorkspaceView:Lcom/nemustech/regina/WorkspaceView;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 32
    const-string v0, "RGWorkspace"

    sput-object v0, Lcom/nemustech/regina/RGWorkspace;->TAG:Ljava/lang/String;

    .line 33
    const/4 v0, 0x0

    sput-boolean v0, Lcom/nemustech/regina/RGWorkspace;->ELEMENT_BITMAP:Z

    return-void
.end method

.method public constructor <init>(Lcom/nemustech/tiffany/world/TFWorld;Lcom/nemustech/regina/ReginaLauncher;I)V
    .locals 6
    .parameter "world"
    .parameter "reginaLauncher"
    .parameter "UID"

    .prologue
    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 72
    invoke-direct {p0, v4}, Lcom/nemustech/tiffany/world/TFPlaceHolder;-><init>(Z)V

    .line 64
    iput-boolean v5, p0, Lcom/nemustech/regina/RGWorkspace;->mPaused:Z

    .line 134
    new-instance v1, Lcom/nemustech/regina/RGWorkspace$1;

    invoke-direct {v1, p0}, Lcom/nemustech/regina/RGWorkspace$1;-><init>(Lcom/nemustech/regina/RGWorkspace;)V

    iput-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mJitImageProvider:Lcom/nemustech/tiffany/world/TFModel$JitImageProvider;

    .line 75
    invoke-virtual {p0, v5}, Lcom/nemustech/regina/RGWorkspace;->prepareReservedParam(I)V

    .line 76
    invoke-virtual {p0, v4, p3}, Lcom/nemustech/regina/RGWorkspace;->setReservedParam(II)V

    .line 78
    sget-object v1, Lcom/nemustech/regina/RGWorkspace;->TAG:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Workspace created, "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mDescription:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 81
    new-instance v1, Ljava/util/LinkedHashMap;

    invoke-direct {v1}, Ljava/util/LinkedHashMap;-><init>()V

    iput-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mPendingEvent:Ljava/util/LinkedHashMap;

    .line 83
    iput-object p1, p0, Lcom/nemustech/regina/RGWorkspace;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    .line 84
    iput-object p2, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    .line 86
    new-instance v1, Lcom/nemustech/tiffany/world/TFPlaceHolder;

    invoke-direct {v1, v5}, Lcom/nemustech/tiffany/world/TFPlaceHolder;-><init>(Z)V

    iput-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    .line 87
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Panel Element Holder for uid"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    iput-object v2, v1, Lcom/nemustech/tiffany/world/TFPlaceHolder;->mDescription:Ljava/lang/String;

    .line 88
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    invoke-virtual {v1, p0}, Lcom/nemustech/tiffany/world/TFPlaceHolder;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    .line 89
    invoke-direct {p0}, Lcom/nemustech/regina/RGWorkspace;->createBackgroundPanel()Lcom/nemustech/regina/WallpaperPanel;

    move-result-object v1

    iput-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundPanel:Lcom/nemustech/regina/WallpaperPanel;

    .line 90
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundPanel:Lcom/nemustech/regina/WallpaperPanel;

    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    invoke-virtual {v1, v2}, Lcom/nemustech/regina/WallpaperPanel;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    .line 92
    invoke-direct {p0}, Lcom/nemustech/regina/RGWorkspace;->createBackgroundPanel()Lcom/nemustech/regina/WallpaperPanel;

    move-result-object v1

    iput-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundThumbPanel:Lcom/nemustech/regina/WallpaperPanel;

    .line 93
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundThumbPanel:Lcom/nemustech/regina/WallpaperPanel;

    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    invoke-virtual {v1, v2}, Lcom/nemustech/regina/WallpaperPanel;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    .line 94
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundThumbPanel:Lcom/nemustech/regina/WallpaperPanel;

    invoke-virtual {v1, v4}, Lcom/nemustech/regina/WallpaperPanel;->setVisibility(Z)V

    .line 96
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    iput-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    .line 98
    invoke-direct {p0}, Lcom/nemustech/regina/RGWorkspace;->createWorkspaceThumbPanel()Lcom/nemustech/tiffany/world/TFPanel;

    move-result-object v1

    iput-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mElementPanel:Lcom/nemustech/tiffany/world/TFPanel;

    .line 99
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mElementPanel:Lcom/nemustech/tiffany/world/TFPanel;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "ElementPanel for uid "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    iput-object v2, v1, Lcom/nemustech/tiffany/world/TFPanel;->mDescription:Ljava/lang/String;

    .line 100
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mElementPanel:Lcom/nemustech/tiffany/world/TFPanel;

    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mJitImageProvider:Lcom/nemustech/tiffany/world/TFModel$JitImageProvider;

    invoke-virtual {v1, v2}, Lcom/nemustech/tiffany/world/TFPanel;->setJitImageProvider(Lcom/nemustech/tiffany/world/TFModel$JitImageProvider;)V

    .line 101
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mElementPanel:Lcom/nemustech/tiffany/world/TFPanel;

    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    invoke-virtual {v1, v2}, Lcom/nemustech/tiffany/world/TFPanel;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    .line 102
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mElementPanel:Lcom/nemustech/tiffany/world/TFPanel;

    invoke-virtual {v1, v4}, Lcom/nemustech/tiffany/world/TFPanel;->setVisibility(Z)V

    .line 103
    const/high16 v1, 0x3f00

    invoke-virtual {p0, v1}, Lcom/nemustech/regina/RGWorkspace;->updateThumb(F)V

    .line 105
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-static {v1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    .line 106
    .local v0, layoutInflater:Landroid/view/LayoutInflater;
    const v1, 0x7f030014

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v1

    check-cast v1, Lcom/nemustech/regina/WorkspaceView;

    iput-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mWorkspaceView:Lcom/nemustech/regina/WorkspaceView;

    .line 107
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mWorkspaceView:Lcom/nemustech/regina/WorkspaceView;

    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v1, v2}, Lcom/nemustech/regina/WorkspaceView;->setMainActivity(Lcom/nemustech/regina/ReginaLauncher;)V

    .line 109
    new-instance v1, Landroid/os/Handler;

    invoke-direct {v1}, Landroid/os/Handler;-><init>()V

    iput-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mHandler:Landroid/os/Handler;

    .line 132
    return-void
.end method

.method static synthetic access$000(Lcom/nemustech/regina/RGWorkspace;)Landroid/os/Handler;
    .locals 1
    .parameter "x0"

    .prologue
    .line 31
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mHandler:Landroid/os/Handler;

    return-object v0
.end method

.method static synthetic access$100(Lcom/nemustech/regina/RGWorkspace;)Lcom/nemustech/regina/WorkspaceView;
    .locals 1
    .parameter "x0"

    .prologue
    .line 31
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mWorkspaceView:Lcom/nemustech/regina/WorkspaceView;

    return-object v0
.end method

.method private createBackgroundPanel()Lcom/nemustech/regina/WallpaperPanel;
    .locals 7

    .prologue
    const/high16 v6, 0x3f80

    .line 185
    iget-object v4, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-static {v4}, Lcom/nemustech/regina/RUtils;->getScreenWidthAvailable(Landroid/content/Context;)I

    move-result v3

    .line 186
    .local v3, screenWidth:I
    iget-object v4, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-static {v4}, Lcom/nemustech/regina/RUtils;->getScreenHeightAvailable(Landroid/content/Context;)I

    move-result v2

    .line 187
    .local v2, screenHeight:I
    int-to-float v4, v2

    int-to-float v5, v3

    div-float v1, v4, v5

    .line 188
    .local v1, ratio:F
    new-instance v0, Lcom/nemustech/regina/WallpaperPanel;

    iget-object v4, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    mul-float v5, v6, v1

    invoke-direct {v0, v4, v6, v5}, Lcom/nemustech/regina/WallpaperPanel;-><init>(Lcom/nemustech/regina/ReginaLauncher;FF)V

    .line 189
    .local v0, backgroundPanel:Lcom/nemustech/regina/WallpaperPanel;
    const/4 v4, 0x1

    invoke-virtual {v0, v4}, Lcom/nemustech/regina/WallpaperPanel;->setBeautyReflection(Z)V

    .line 190
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "workspace background panel for uid "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {p0}, Lcom/nemustech/regina/RGWorkspace;->getUID()I

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    iput-object v4, v0, Lcom/nemustech/regina/WallpaperPanel;->mDescription:Ljava/lang/String;

    .line 191
    return-object v0
.end method

.method private createWorkspaceMiniature()Lcom/nemustech/tiffany/world/TFPlaceHolder;
    .locals 11
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/CloneNotSupportedException;
        }
    .end annotation

    .prologue
    const/4 v10, 0x0

    const/high16 v9, 0x3f80

    .line 238
    new-instance v4, Lcom/nemustech/tiffany/world/TFPlaceHolder;

    invoke-direct {v4, v10}, Lcom/nemustech/tiffany/world/TFPlaceHolder;-><init>(Z)V

    .line 239
    .local v4, workspace:Lcom/nemustech/tiffany/world/TFPlaceHolder;
    new-instance v0, Lcom/nemustech/tiffany/world/TFPlaceHolder;

    const/4 v7, 0x1

    invoke-direct {v0, v7}, Lcom/nemustech/tiffany/world/TFPlaceHolder;-><init>(Z)V

    .line 240
    .local v0, background:Lcom/nemustech/tiffany/world/TFPlaceHolder;
    const-string v7, "Miniature workspace n clone "

    iput-object v7, v4, Lcom/nemustech/tiffany/world/TFPlaceHolder;->mDescription:Ljava/lang/String;

    .line 241
    const-string v7, "Miniature workspace background holder"

    iput-object v7, v0, Lcom/nemustech/tiffany/world/TFPlaceHolder;->mDescription:Ljava/lang/String;

    .line 243
    iget-object v7, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-static {v7}, Lcom/nemustech/regina/RUtils;->getScreenWidthAvailable(Landroid/content/Context;)I

    move-result v3

    .line 244
    .local v3, screenWidth:I
    iget-object v7, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-static {v7}, Lcom/nemustech/regina/RUtils;->getScreenHeightAvailable(Landroid/content/Context;)I

    move-result v2

    .line 245
    .local v2, screenHeight:I
    int-to-float v7, v2

    int-to-float v8, v3

    div-float v1, v7, v8

    .line 246
    .local v1, ratio:F
    new-instance v6, Lcom/nemustech/tiffany/world/TFPanel;

    mul-float v7, v9, v1

    invoke-direct {v6, v9, v7}, Lcom/nemustech/tiffany/world/TFPanel;-><init>(FF)V

    .line 247
    .local v6, workspaceThumbPanel:Lcom/nemustech/tiffany/world/TFPanel;
    const/high16 v7, 0x3f00

    invoke-virtual {p0, v7}, Lcom/nemustech/regina/RGWorkspace;->getSnapShot(F)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 248
    .local v5, workspaceBmp:Landroid/graphics/Bitmap;
    invoke-virtual {v6, v10, v5}, Lcom/nemustech/tiffany/world/TFPanel;->setImageResource(ILandroid/graphics/Bitmap;)Z

    move-result v7

    if-eqz v7, :cond_0

    .line 249
    invoke-virtual {v5}, Landroid/graphics/Bitmap;->recycle()V

    .line 251
    :cond_0
    invoke-virtual {v6, v0}, Lcom/nemustech/tiffany/world/TFPanel;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    .line 252
    invoke-virtual {v0, v4}, Lcom/nemustech/tiffany/world/TFPlaceHolder;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    .line 253
    invoke-virtual {p0}, Lcom/nemustech/regina/RGWorkspace;->clone()Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/nemustech/tiffany/world/TFHolder;

    invoke-virtual {p0, v4}, Lcom/nemustech/tiffany/world/TFHolder;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    .line 255
    return-object v4
.end method

.method private createWorkspaceThumbPanel()Lcom/nemustech/tiffany/world/TFPanel;
    .locals 7

    .prologue
    const/high16 v6, 0x3f80

    .line 228
    iget-object v4, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-static {v4}, Lcom/nemustech/regina/RUtils;->getScreenWidthAvailable(Landroid/content/Context;)I

    move-result v2

    .line 229
    .local v2, screenWidth:I
    iget-object v4, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-static {v4}, Lcom/nemustech/regina/RUtils;->getScreenHeightAvailable(Landroid/content/Context;)I

    move-result v1

    .line 230
    .local v1, screenHeight:I
    int-to-float v4, v1

    int-to-float v5, v2

    div-float v0, v4, v5

    .line 231
    .local v0, ratio:F
    new-instance v3, Lcom/nemustech/tiffany/world/TFPanel;

    mul-float v4, v6, v0

    invoke-direct {v3, v6, v4}, Lcom/nemustech/tiffany/world/TFPanel;-><init>(FF)V

    .line 232
    .local v3, workspaceThumbPanel:Lcom/nemustech/tiffany/world/TFPanel;
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "workspace element panel for uid "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {p0}, Lcom/nemustech/regina/RGWorkspace;->getUID()I

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    iput-object v4, v3, Lcom/nemustech/tiffany/world/TFPanel;->mDescription:Ljava/lang/String;

    .line 233
    const/4 v4, 0x1

    invoke-virtual {v3, v4}, Lcom/nemustech/tiffany/world/TFPanel;->setBeautyReflection(Z)V

    .line 234
    return-object v3
.end method


# virtual methods
.method public addPendingEvent(Ljava/lang/Long;Ljava/lang/Runnable;)V
    .locals 2
    .parameter "id"
    .parameter "runnable"

    .prologue
    .line 259
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mPendingEvent:Ljava/util/LinkedHashMap;

    monitor-enter v0

    .line 261
    :try_start_0
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mPendingEvent:Ljava/util/LinkedHashMap;

    invoke-virtual {v1, p1, p2}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 262
    monitor-exit v0

    .line 263
    return-void

    .line 262
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public attachElement(Lcom/nemustech/regina/Element;)Z
    .locals 5
    .parameter "element"

    .prologue
    .line 298
    invoke-virtual {p1}, Lcom/nemustech/regina/Element;->switchToElementObject()Lcom/nemustech/regina/Element;

    .line 299
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v3, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 301
    invoke-virtual {p1}, Lcom/nemustech/regina/Element;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v1

    .line 302
    .local v1, object:Lcom/nemustech/tiffany/world/TFObject;
    instance-of v3, v1, Lcom/nemustech/tiffany/world/TFModel;

    if-eqz v3, :cond_1

    .line 303
    move-object v0, v1

    check-cast v0, Lcom/nemustech/tiffany/world/TFModel;

    move-object v3, v0

    invoke-virtual {v3}, Lcom/nemustech/tiffany/world/TFModel;->getParentHolder()Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v3

    if-nez v3, :cond_0

    .line 304
    check-cast v1, Lcom/nemustech/tiffany/world/TFModel;

    .end local v1           #object:Lcom/nemustech/tiffany/world/TFObject;
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    invoke-virtual {v1, v3}, Lcom/nemustech/tiffany/world/TFModel;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    .line 311
    :cond_0
    :goto_0
    instance-of v3, p1, Lcom/nemustech/regina/ElementAndroidWidget;

    if-eqz v3, :cond_2

    .line 312
    move-object v0, p1

    check-cast v0, Lcom/nemustech/regina/ElementAndroidWidget;

    move-object v2, v0

    .line 315
    .local v2, widget:Lcom/nemustech/regina/ElementAndroidWidget;
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mHandler:Landroid/os/Handler;

    new-instance v4, Lcom/nemustech/regina/RGWorkspace$2;

    invoke-direct {v4, p0, v2}, Lcom/nemustech/regina/RGWorkspace$2;-><init>(Lcom/nemustech/regina/RGWorkspace;Lcom/nemustech/regina/ElementAndroidWidget;)V

    invoke-virtual {v3, v4}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 333
    .end local v2           #widget:Lcom/nemustech/regina/ElementAndroidWidget;
    :goto_1
    const-string v3, "Attached element"

    invoke-static {v3}, Lcom/nemustech/tiffany/world/TFUtils;->dumpFreeMemory(Ljava/lang/String;)V

    .line 334
    const/4 v3, 0x1

    return v3

    .line 306
    .restart local v1       #object:Lcom/nemustech/tiffany/world/TFObject;
    :cond_1
    move-object v0, v1

    check-cast v0, Lcom/nemustech/tiffany/world/TFHolder;

    move-object v3, v0

    invoke-virtual {v3}, Lcom/nemustech/tiffany/world/TFHolder;->getParentHolder()Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v3

    if-nez v3, :cond_0

    .line 307
    check-cast v1, Lcom/nemustech/tiffany/world/TFHolder;

    .end local v1           #object:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {v1, p0}, Lcom/nemustech/tiffany/world/TFHolder;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    goto :goto_0

    .line 327
    :cond_2
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mHandler:Landroid/os/Handler;

    new-instance v4, Lcom/nemustech/regina/RGWorkspace$3;

    invoke-direct {v4, p0}, Lcom/nemustech/regina/RGWorkspace$3;-><init>(Lcom/nemustech/regina/RGWorkspace;)V

    invoke-virtual {v3, v4}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    goto :goto_1
.end method

.method public cacheTexture(Z)V
    .locals 7
    .parameter "mode"

    .prologue
    const/4 v6, 0x1

    const/4 v5, 0x0

    .line 605
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundPanel:Lcom/nemustech/regina/WallpaperPanel;

    if-nez p1, :cond_1

    move v4, v6

    :goto_0
    invoke-virtual {v3, v5, v4}, Lcom/nemustech/regina/WallpaperPanel;->handleTextureMemory(IZ)V

    .line 608
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :cond_0
    :goto_1
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_5

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/nemustech/regina/Element;

    .line 609
    .local v0, e:Lcom/nemustech/regina/Element;
    invoke-virtual {v0}, Lcom/nemustech/regina/Element;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v2

    .line 610
    .local v2, o:Lcom/nemustech/tiffany/world/TFObject;
    instance-of v3, v2, Lcom/nemustech/tiffany/world/TFModel;

    if-eqz v3, :cond_3

    .line 611
    check-cast v2, Lcom/nemustech/tiffany/world/TFModel;

    .end local v2           #o:Lcom/nemustech/tiffany/world/TFObject;
    if-nez p1, :cond_2

    move v3, v6

    :goto_2
    invoke-virtual {v2, v3}, Lcom/nemustech/tiffany/world/TFModel;->handleTextureMemory(Z)V

    goto :goto_1

    .end local v0           #e:Lcom/nemustech/regina/Element;
    .end local v1           #i$:Ljava/util/Iterator;
    :cond_1
    move v4, v5

    .line 605
    goto :goto_0

    .restart local v0       #e:Lcom/nemustech/regina/Element;
    .restart local v1       #i$:Ljava/util/Iterator;
    :cond_2
    move v3, v5

    .line 611
    goto :goto_2

    .line 612
    .restart local v2       #o:Lcom/nemustech/tiffany/world/TFObject;
    :cond_3
    instance-of v3, v2, Lcom/nemustech/tiffany/world/TFHolder;

    if-eqz v3, :cond_0

    .line 613
    check-cast v2, Lcom/nemustech/tiffany/world/TFHolder;

    .end local v2           #o:Lcom/nemustech/tiffany/world/TFObject;
    if-nez p1, :cond_4

    move v3, v6

    :goto_3
    invoke-virtual {v2, v3}, Lcom/nemustech/tiffany/world/TFHolder;->handleTextureMemory(Z)V

    goto :goto_1

    :cond_4
    move v3, v5

    goto :goto_3

    .line 615
    .end local v0           #e:Lcom/nemustech/regina/Element;
    :cond_5
    return-void
.end method

.method public convertToAnimationObjects(Z)V
    .locals 1
    .parameter "isAll"

    .prologue
    .line 568
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/nemustech/regina/RGWorkspace;->convertToAnimationObjects(ZLcom/nemustech/regina/Element;)V

    .line 569
    return-void
.end method

.method public convertToAnimationObjects(ZLcom/nemustech/regina/Element;)V
    .locals 3
    .parameter "isAll"
    .parameter "exception"

    .prologue
    .line 558
    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_2

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/nemustech/regina/Element;

    .line 559
    .local v0, e:Lcom/nemustech/regina/Element;
    invoke-virtual {v0}, Lcom/nemustech/regina/Element;->isAnimationObject()Z

    move-result v2

    if-nez v2, :cond_0

    if-eq v0, p2, :cond_0

    .line 560
    instance-of v2, v0, Lcom/nemustech/regina/ElementAndroidWidget;

    if-nez v2, :cond_1

    if-eqz p1, :cond_0

    .line 561
    :cond_1
    invoke-virtual {v0}, Lcom/nemustech/regina/Element;->switchToAnimationObject()Lcom/nemustech/tiffany/world/TFCustomPanel;

    goto :goto_0

    .line 565
    .end local v0           #e:Lcom/nemustech/regina/Element;
    :cond_2
    return-void
.end method

.method public convertToElementObjects(Z)V
    .locals 1
    .parameter "isAll"

    .prologue
    .line 583
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/nemustech/regina/RGWorkspace;->convertToElementObjects(ZLcom/nemustech/regina/Element;)V

    .line 584
    return-void
.end method

.method public convertToElementObjects(ZLcom/nemustech/regina/Element;)V
    .locals 3
    .parameter "isAll"
    .parameter "exception"

    .prologue
    .line 573
    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_2

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/nemustech/regina/Element;

    .line 574
    .local v0, e:Lcom/nemustech/regina/Element;
    invoke-virtual {v0}, Lcom/nemustech/regina/Element;->isAnimationObject()Z

    move-result v2

    if-eqz v2, :cond_0

    if-eq v0, p2, :cond_0

    .line 575
    instance-of v2, v0, Lcom/nemustech/regina/ElementAndroidWidget;

    if-nez v2, :cond_1

    if-eqz p1, :cond_0

    .line 576
    :cond_1
    invoke-virtual {v0}, Lcom/nemustech/regina/Element;->switchToElementObject()Lcom/nemustech/regina/Element;

    goto :goto_0

    .line 580
    .end local v0           #e:Lcom/nemustech/regina/Element;
    :cond_2
    return-void
.end method

.method public detachElement(Lcom/nemustech/regina/Element;)Z
    .locals 3
    .parameter "element"

    .prologue
    const/4 v2, 0x0

    .line 341
    const-string v1, "Detach element"

    invoke-static {v1}, Lcom/nemustech/tiffany/world/TFUtils;->dumpFreeMemory(Ljava/lang/String;)V

    .line 342
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v1, p1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    .line 344
    invoke-virtual {p1}, Lcom/nemustech/regina/Element;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v0

    .line 345
    .local v0, object:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {p1}, Lcom/nemustech/regina/Element;->getInternalObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v1

    if-eq v0, v1, :cond_0

    new-instance v1, Ljava/lang/IllegalStateException;

    const-string v2, "Getting internal object failed"

    invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v1

    .line 348
    :cond_0
    invoke-virtual {p1}, Lcom/nemustech/regina/Element;->switchToAnimationObject()Lcom/nemustech/tiffany/world/TFCustomPanel;

    .line 350
    instance-of v1, v0, Lcom/nemustech/tiffany/world/TFModel;

    if-eqz v1, :cond_1

    .line 351
    check-cast v0, Lcom/nemustech/tiffany/world/TFModel;

    .end local v0           #object:Lcom/nemustech/tiffany/world/TFObject;
    iget-object v1, p0, Lcom/nemustech/regina/RGWorkspace;->mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    invoke-virtual {v0, v1, v2}, Lcom/nemustech/tiffany/world/TFModel;->detachFrom(Lcom/nemustech/tiffany/world/TFHolder;Z)V

    .line 355
    :goto_0
    const/high16 v1, 0x3f00

    invoke-virtual {p0, v1}, Lcom/nemustech/regina/RGWorkspace;->updateThumb(F)V

    .line 356
    const/4 v1, 0x1

    return v1

    .line 353
    .restart local v0       #object:Lcom/nemustech/tiffany/world/TFObject;
    :cond_1
    check-cast v0, Lcom/nemustech/tiffany/world/TFHolder;

    .end local v0           #object:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {v0, p0, v2}, Lcom/nemustech/tiffany/world/TFHolder;->detachFrom(Lcom/nemustech/tiffany/world/TFHolder;Z)V

    goto :goto_0
.end method

.method public dispatchPendingEvent()V
    .locals 3

    .prologue
    .line 270
    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mPendingEvent:Ljava/util/LinkedHashMap;

    invoke-virtual {v2}, Ljava/util/LinkedHashMap;->values()Ljava/util/Collection;

    move-result-object v1

    .line 271
    .local v1, pendingEvents:Ljava/util/Collection;,"Ljava/util/Collection<Ljava/lang/Runnable;>;"
    invoke-interface {v1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .line 272
    .local v0, iterator:Ljava/util/Iterator;,"Ljava/util/Iterator<Ljava/lang/Runnable;>;"
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 273
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/Runnable;

    invoke-interface {v2}, Ljava/lang/Runnable;->run()V

    goto :goto_0

    .line 275
    :cond_0
    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mPendingEvent:Ljava/util/LinkedHashMap;

    invoke-virtual {v2}, Ljava/util/LinkedHashMap;->clear()V

    .line 276
    return-void
.end method

.method public findElementByAppWidgetId(I)Lcom/nemustech/regina/Element;
    .locals 7
    .parameter "appWidgetId"

    .prologue
    .line 393
    iget-object v6, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v6}, Ljava/util/ArrayList;->size()I

    move-result v1

    .line 394
    .local v1, cnt:I
    const/4 v5, 0x0

    .line 395
    .local v5, resultElement:Lcom/nemustech/regina/Element;
    const/4 v4, 0x0

    .local v4, i:I
    :goto_0
    if-ge v4, v1, :cond_0

    .line 396
    iget-object v6, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v6, v4}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/nemustech/regina/Element;

    .line 397
    .local v2, element:Lcom/nemustech/regina/Element;
    instance-of v6, v2, Lcom/nemustech/regina/ElementAndroidWidget;

    if-eqz v6, :cond_1

    .line 398
    move-object v0, v2

    check-cast v0, Lcom/nemustech/regina/ElementAndroidWidget;

    move-object v6, v0

    invoke-virtual {v6}, Lcom/nemustech/regina/ElementAndroidWidget;->getWidgetId()I

    move-result v3

    .line 399
    .local v3, elementWidgetId:I
    if-ne p1, v3, :cond_1

    .line 400
    move-object v5, v2

    .line 406
    .end local v2           #element:Lcom/nemustech/regina/Element;
    .end local v3           #elementWidgetId:I
    :cond_0
    return-object v5

    .line 395
    .restart local v2       #element:Lcom/nemustech/regina/Element;
    :cond_1
    add-int/lit8 v4, v4, 0x1

    goto :goto_0
.end method

.method public getBackgroundPanel()Lcom/nemustech/tiffany/world/TFPanel;
    .locals 1

    .prologue
    .line 287
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundPanel:Lcom/nemustech/regina/WallpaperPanel;

    return-object v0
.end method

.method public getBackgroundThumbPanel()Lcom/nemustech/tiffany/world/TFPanel;
    .locals 1

    .prologue
    .line 283
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundThumbPanel:Lcom/nemustech/regina/WallpaperPanel;

    return-object v0
.end method

.method public getElementList()Ljava/util/ArrayList;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/nemustech/regina/Element;",
            ">;"
        }
    .end annotation

    .prologue
    .line 440
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    return-object v0
.end method

.method public getElementPanel()Lcom/nemustech/tiffany/world/TFPanel;
    .locals 1

    .prologue
    .line 279
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mElementPanel:Lcom/nemustech/tiffany/world/TFPanel;

    return-object v0
.end method

.method public getMiniatureWorkspace()Lcom/nemustech/tiffany/world/TFPlaceHolder;
    .locals 1

    .prologue
    .line 291
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mMiniature:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    return-object v0
.end method

.method public getPanelElementHolder()Lcom/nemustech/tiffany/world/TFHolder;
    .locals 1

    .prologue
    .line 436
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mPanelElementHolder:Lcom/nemustech/tiffany/world/TFPlaceHolder;

    return-object v0
.end method

.method public getSnapShot(F)Landroid/graphics/Bitmap;
    .locals 24
    .parameter "scale"

    .prologue
    .line 444
    new-instance v16, Landroid/graphics/Rect;

    invoke-direct/range {v16 .. v16}, Landroid/graphics/Rect;-><init>()V

    .line 445
    .local v16, src:Landroid/graphics/Rect;
    new-instance v9, Landroid/graphics/Rect;

    invoke-direct {v9}, Landroid/graphics/Rect;-><init>()V

    .line 446
    .local v9, dest:Landroid/graphics/Rect;
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    move-object/from16 v19, v0

    invoke-static/range {v19 .. v19}, Lcom/nemustech/regina/RUtils;->getScreenWidthAvailable(Landroid/content/Context;)I

    move-result v14

    .line 447
    .local v14, screenWidth:I
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    move-object/from16 v19, v0

    invoke-static/range {v19 .. v19}, Lcom/nemustech/regina/RUtils;->getScreenHeightAvailable(Landroid/content/Context;)I

    move-result v13

    .line 448
    .local v13, screenHeight:I
    move v0, v14

    int-to-float v0, v0

    move/from16 v19, v0

    mul-float v19, v19, p1

    move/from16 v0, v19

    float-to-int v0, v0

    move/from16 v19, v0

    move v0, v13

    int-to-float v0, v0

    move/from16 v20, v0

    mul-float v20, v20, p1

    move/from16 v0, v20

    float-to-int v0, v0

    move/from16 v20, v0

    sget-object v21, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    invoke-static/range {v19 .. v21}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v15

    .line 449
    .local v15, snapShot:Landroid/graphics/Bitmap;
    new-instance v7, Landroid/graphics/Canvas;

    invoke-direct {v7, v15}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 452
    .local v7, canvas:Landroid/graphics/Canvas;
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    move-object/from16 v19, v0

    invoke-virtual/range {v19 .. v19}, Ljava/util/ArrayList;->size()I

    move-result v8

    .line 453
    .local v8, cnt:I
    const/4 v12, 0x0

    .local v12, i:I
    :goto_0
    if-ge v12, v8, :cond_2

    .line 454
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    move-object/from16 v19, v0

    move-object/from16 v0, v19

    move v1, v12

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Lcom/nemustech/regina/Element;

    .line 455
    .local v10, element:Lcom/nemustech/regina/Element;
    invoke-virtual {v10}, Lcom/nemustech/regina/Element;->getSnapShot()Landroid/graphics/Bitmap;

    move-result-object v11

    .line 456
    .local v11, elementBmp:Landroid/graphics/Bitmap;
    if-eqz v11, :cond_1

    .line 457
    invoke-virtual {v11}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v6

    .line 458
    .local v6, bitmapWidth:I
    invoke-virtual {v11}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v5

    .line 459
    .local v5, bitmapHeight:I
    move v0, v14

    int-to-float v0, v0

    move/from16 v19, v0

    invoke-virtual {v10}, Lcom/nemustech/regina/Element;->getX()F

    move-result v20

    mul-float v19, v19, v20

    sub-int v20, v14, v6

    move/from16 v0, v20

    int-to-float v0, v0

    move/from16 v20, v0

    const/high16 v21, 0x4000

    div-float v20, v20, v21

    add-float v17, v19, v20

    .line 460
    .local v17, x2d:F
    move v0, v14

    neg-int v0, v0

    move/from16 v19, v0

    move/from16 v0, v19

    int-to-float v0, v0

    move/from16 v19, v0

    invoke-virtual {v10}, Lcom/nemustech/regina/Element;->getY()F

    move-result v20

    mul-float v19, v19, v20

    sub-int v20, v13, v5

    move/from16 v0, v20

    int-to-float v0, v0

    move/from16 v20, v0

    const/high16 v21, 0x4000

    div-float v20, v20, v21

    add-float v18, v19, v20

    .line 461
    .local v18, y2d:F
    const/16 v19, 0x0

    const/16 v20, 0x0

    move-object/from16 v0, v16

    move/from16 v1, v19

    move/from16 v2, v20

    move v3, v6

    move v4, v5

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Rect;->set(IIII)V

    .line 462
    mul-float v19, v17, p1

    const/high16 v20, 0x3f00

    add-float v19, v19, v20

    move/from16 v0, v19

    float-to-int v0, v0

    move/from16 v19, v0

    mul-float v20, v18, p1

    const/high16 v21, 0x3f00

    add-float v20, v20, v21

    move/from16 v0, v20

    float-to-int v0, v0

    move/from16 v20, v0

    move v0, v6

    int-to-float v0, v0

    move/from16 v21, v0

    add-float v21, v21, v17

    mul-float v21, v21, p1

    const/high16 v22, 0x3f00

    add-float v21, v21, v22

    move/from16 v0, v21

    float-to-int v0, v0

    move/from16 v21, v0

    move v0, v5

    int-to-float v0, v0

    move/from16 v22, v0

    add-float v22, v22, v18

    mul-float v22, v22, p1

    const/high16 v23, 0x3f00

    add-float v22, v22, v23

    move/from16 v0, v22

    float-to-int v0, v0

    move/from16 v22, v0

    move-object v0, v9

    move/from16 v1, v19

    move/from16 v2, v20

    move/from16 v3, v21

    move/from16 v4, v22

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Rect;->set(IIII)V

    .line 463
    const/16 v19, 0x0

    move-object v0, v7

    move-object v1, v11

    move-object/from16 v2, v16

    move-object v3, v9

    move-object/from16 v4, v19

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    .line 465
    move-object v0, v10

    instance-of v0, v0, Lcom/nemustech/regina/ElementAndroidWidget;

    move/from16 v19, v0

    if-eqz v19, :cond_0

    .line 466
    check-cast v10, Lcom/nemustech/regina/ElementAndroidWidget;

    .end local v10           #element:Lcom/nemustech/regina/Element;
    invoke-virtual {v10}, Lcom/nemustech/regina/ElementAndroidWidget;->updatePanel()V

    .line 453
    .end local v5           #bitmapHeight:I
    .end local v6           #bitmapWidth:I
    .end local v17           #x2d:F
    .end local v18           #y2d:F
    :goto_1
    add-int/lit8 v12, v12, 0x1

    goto/16 :goto_0

    .line 468
    .restart local v5       #bitmapHeight:I
    .restart local v6       #bitmapWidth:I
    .restart local v10       #element:Lcom/nemustech/regina/Element;
    .restart local v17       #x2d:F
    .restart local v18       #y2d:F
    :cond_0
    invoke-virtual {v11}, Landroid/graphics/Bitmap;->recycle()V

    goto :goto_1

    .line 473
    .end local v5           #bitmapHeight:I
    .end local v6           #bitmapWidth:I
    .end local v17           #x2d:F
    .end local v18           #y2d:F
    :cond_1
    sget-object v19, Lcom/nemustech/regina/RGWorkspace;->TAG:Ljava/lang/String;

    const-string v20, "Element Bitmap is null"

    sget-boolean v21, Lcom/nemustech/regina/RGWorkspace;->ELEMENT_BITMAP:Z

    invoke-static/range {v19 .. v21}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    goto :goto_1

    .line 476
    .end local v10           #element:Lcom/nemustech/regina/Element;
    .end local v11           #elementBmp:Landroid/graphics/Bitmap;
    :cond_2
    return-object v15
.end method

.method public getUID()I
    .locals 1

    .prologue
    .line 598
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/nemustech/regina/RGWorkspace;->getReservedParam(I)I

    move-result v0

    return v0
.end method

.method public getWorkspaceView()Lcom/nemustech/regina/WorkspaceView;
    .locals 1

    .prologue
    .line 181
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mWorkspaceView:Lcom/nemustech/regina/WorkspaceView;

    return-object v0
.end method

.method public hasPendingEvent()Z
    .locals 1

    .prologue
    .line 266
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mPendingEvent:Ljava/util/LinkedHashMap;

    invoke-virtual {v0}, Ljava/util/LinkedHashMap;->size()I

    move-result v0

    if-lez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public isOnExternalStorage(Ljava/lang/String;)Z
    .locals 6
    .parameter "packageName"

    .prologue
    const/high16 v5, 0x4

    const/4 v4, 0x0

    .line 427
    :try_start_0
    iget-object v2, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v2}, Lcom/nemustech/regina/ReginaLauncher;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v2, p1, v3}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;

    move-result-object v1

    .line 428
    .local v1, info:Landroid/content/pm/ApplicationInfo;
    iget v2, v1, Landroid/content/pm/ApplicationInfo;->flags:I
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    and-int/2addr v2, v5

    if-ne v2, v5, :cond_0

    const/4 v2, 0x1

    .line 432
    .end local v1           #info:Landroid/content/pm/ApplicationInfo;
    :goto_0
    return v2

    .restart local v1       #info:Landroid/content/pm/ApplicationInfo;
    :cond_0
    move v2, v4

    .line 428
    goto :goto_0

    .line 429
    .end local v1           #info:Landroid/content/pm/ApplicationInfo;
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 430
    .local v0, e:Landroid/content/pm/PackageManager$NameNotFoundException;
    invoke-virtual {v0}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V

    move v2, v4

    .line 432
    goto :goto_0
.end method

.method public isPaused()Z
    .locals 1

    .prologue
    .line 177
    iget-boolean v0, p0, Lcom/nemustech/regina/RGWorkspace;->mPaused:Z

    return v0
.end method

.method public isRequestedUpdate()Z
    .locals 1

    .prologue
    .line 146
    iget-boolean v0, p0, Lcom/nemustech/regina/RGWorkspace;->mRequestUpdate:Z

    return v0
.end method

.method public pause()V
    .locals 5

    .prologue
    .line 160
    invoke-virtual {p0}, Lcom/nemustech/regina/RGWorkspace;->getElementList()Ljava/util/ArrayList;

    move-result-object v2

    .line 161
    .local v2, elems:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/nemustech/regina/Element;>;"
    const/4 v0, 0x0

    .line 162
    .local v0, count:I
    invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    .local v3, i$:Ljava/util/Iterator;
    :cond_0
    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_1

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/nemustech/regina/Element;

    .line 163
    .local v1, e:Lcom/nemustech/regina/Element;
    instance-of v4, v1, Lcom/nemustech/regina/ElementReginaWidget;

    if-eqz v4, :cond_0

    .line 164
    invoke-virtual {v1}, Lcom/nemustech/regina/Element;->pause()V

    .line 165
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 168
    .end local v1           #e:Lcom/nemustech/regina/Element;
    :cond_1
    if-lez v0, :cond_2

    .line 169
    const/4 v4, 0x1

    iput-boolean v4, p0, Lcom/nemustech/regina/RGWorkspace;->mPaused:Z

    .line 174
    :goto_1
    return-void

    .line 172
    :cond_2
    const/4 v4, 0x0

    iput-boolean v4, p0, Lcom/nemustech/regina/RGWorkspace;->mPaused:Z

    goto :goto_1
.end method

.method public refreshElementShorcutIcon()V
    .locals 6

    .prologue
    .line 410
    const/4 v3, 0x0

    .line 411
    .local v3, isRefreshed:Z
    iget-object v5, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v5}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .local v2, i$:Ljava/util/Iterator;
    :cond_0
    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_1

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/nemustech/regina/Element;

    .line 412
    .local v1, e:Lcom/nemustech/regina/Element;
    instance-of v5, v1, Lcom/nemustech/regina/ElementShortcut;

    if-eqz v5, :cond_0

    .line 413
    move-object v0, v1

    check-cast v0, Lcom/nemustech/regina/ElementShortcut;

    move-object v5, v0

    invoke-virtual {v5}, Lcom/nemustech/regina/ElementShortcut;->getPackageName()Ljava/lang/String;

    move-result-object v4

    .line 414
    .local v4, packageName:Ljava/lang/String;
    if-eqz v4, :cond_0

    invoke-virtual {p0, v4}, Lcom/nemustech/regina/RGWorkspace;->isOnExternalStorage(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_0

    .line 415
    check-cast v1, Lcom/nemustech/regina/ElementShortcut;

    .end local v1           #e:Lcom/nemustech/regina/Element;
    iget-object v5, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v1, v5}, Lcom/nemustech/regina/ElementShortcut;->refreshIcon(Landroid/content/Context;)V

    .line 416
    const/4 v3, 0x1

    goto :goto_0

    .line 420
    .end local v4           #packageName:Ljava/lang/String;
    :cond_1
    if-eqz v3, :cond_2

    .line 421
    invoke-virtual {p0}, Lcom/nemustech/regina/RGWorkspace;->requestUpdate()V

    .line 422
    :cond_2
    return-void
.end method

.method public removeElement(Lcom/nemustech/regina/Element;)Z
    .locals 7
    .parameter "element"

    .prologue
    .line 361
    invoke-virtual {p1}, Lcom/nemustech/regina/Element;->onDestroy()V

    .line 362
    instance-of v3, p1, Lcom/nemustech/regina/ElementAndroidWidget;

    if-nez v3, :cond_0

    const/4 v3, 0x0

    invoke-virtual {p1, v3}, Lcom/nemustech/regina/Element;->switchToElementObject(Z)Lcom/nemustech/regina/Element;

    .line 363
    :cond_0
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v3, p1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    .line 365
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mPendingEvent:Ljava/util/LinkedHashMap;

    new-instance v4, Ljava/lang/Long;

    invoke-virtual {p1}, Lcom/nemustech/regina/Element;->getElementId()J

    move-result-wide v5

    invoke-direct {v4, v5, v6}, Ljava/lang/Long;-><init>(J)V

    invoke-virtual {v3, v4}, Ljava/util/LinkedHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 367
    invoke-virtual {p1}, Lcom/nemustech/regina/Element;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v1

    .line 368
    .local v1, object:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {v1}, Lcom/nemustech/tiffany/world/TFObject;->getWorld()Lcom/nemustech/tiffany/world/TFWorld;

    move-result-object v3

    if-eqz v3, :cond_1

    .line 369
    instance-of v3, v1, Lcom/nemustech/tiffany/world/TFModel;

    if-eqz v3, :cond_3

    .line 370
    check-cast v1, Lcom/nemustech/tiffany/world/TFModel;

    .end local v1           #object:Lcom/nemustech/tiffany/world/TFObject;
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {v1, v3}, Lcom/nemustech/tiffany/world/TFModel;->detachFrom(Lcom/nemustech/tiffany/world/TFWorld;)V

    .line 375
    :cond_1
    :goto_0
    instance-of v3, p1, Lcom/nemustech/regina/ElementAndroidWidget;

    if-eqz v3, :cond_2

    .line 376
    move-object v0, p1

    check-cast v0, Lcom/nemustech/regina/ElementAndroidWidget;

    move-object v2, v0

    .line 378
    .local v2, widget:Lcom/nemustech/regina/ElementAndroidWidget;
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    new-instance v4, Lcom/nemustech/regina/RGWorkspace$4;

    invoke-direct {v4, p0, v2}, Lcom/nemustech/regina/RGWorkspace$4;-><init>(Lcom/nemustech/regina/RGWorkspace;Lcom/nemustech/regina/ElementAndroidWidget;)V

    invoke-virtual {v3, v4}, Lcom/nemustech/regina/ReginaLauncher;->runOnUiThread(Ljava/lang/Runnable;)V

    .line 384
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v3}, Lcom/nemustech/regina/ReginaLauncher;->getAppWidgetHost()Landroid/appwidget/AppWidgetHost;

    move-result-object v3

    invoke-virtual {v2}, Lcom/nemustech/regina/ElementAndroidWidget;->getWidgetId()I

    move-result v4

    invoke-virtual {v3, v4}, Landroid/appwidget/AppWidgetHost;->deleteAppWidgetId(I)V

    .line 387
    .end local v2           #widget:Lcom/nemustech/regina/ElementAndroidWidget;
    :cond_2
    const/high16 v3, 0x3f00

    invoke-virtual {p0, v3}, Lcom/nemustech/regina/RGWorkspace;->updateThumb(F)V

    .line 388
    const/4 v3, 0x1

    return v3

    .line 372
    .restart local v1       #object:Lcom/nemustech/tiffany/world/TFObject;
    :cond_3
    check-cast v1, Lcom/nemustech/tiffany/world/TFHolder;

    .end local v1           #object:Lcom/nemustech/tiffany/world/TFObject;
    iget-object v3, p0, Lcom/nemustech/regina/RGWorkspace;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {v1, v3}, Lcom/nemustech/tiffany/world/TFHolder;->detachFrom(Lcom/nemustech/tiffany/world/TFWorld;)V

    goto :goto_0
.end method

.method public requestUpdate()V
    .locals 1

    .prologue
    .line 142
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/regina/RGWorkspace;->mRequestUpdate:Z

    .line 143
    return-void
.end method

.method public resume()V
    .locals 4

    .prologue
    .line 150
    invoke-virtual {p0}, Lcom/nemustech/regina/RGWorkspace;->getElementList()Ljava/util/ArrayList;

    move-result-object v1

    .line 151
    .local v1, elems:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/nemustech/regina/Element;>;"
    invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .local v2, i$:Ljava/util/Iterator;
    :cond_0
    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/nemustech/regina/Element;

    .line 152
    .local v0, e:Lcom/nemustech/regina/Element;
    instance-of v3, v0, Lcom/nemustech/regina/ElementReginaWidget;

    if-eqz v3, :cond_0

    .line 153
    invoke-virtual {v0}, Lcom/nemustech/regina/Element;->resume()V

    goto :goto_0

    .line 156
    .end local v0           #e:Lcom/nemustech/regina/Element;
    :cond_1
    const/4 v3, 0x0

    iput-boolean v3, p0, Lcom/nemustech/regina/RGWorkspace;->mPaused:Z

    .line 157
    return-void
.end method

.method public setVisibility(Z)V
    .locals 0
    .parameter "visible"

    .prologue
    .line 620
    invoke-super {p0, p1}, Lcom/nemustech/tiffany/world/TFPlaceHolder;->setVisibility(Z)V

    .line 621
    return-void
.end method

.method public setWallPaper(Ljava/lang/String;)V
    .locals 9
    .parameter "fileName"

    .prologue
    .line 195
    const-class v4, Ljava/lang/Object;

    monitor-enter v4

    .line 196
    if-eqz p1, :cond_2

    .line 197
    :try_start_0
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v5

    if-lez v5, :cond_1

    const-string v5, ".png"

    invoke-virtual {p1, v5}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_1

    .line 198
    sget-object v5, Lcom/nemustech/regina/RGWorkspace;->TAG:Ljava/lang/String;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "[setWallPaper()] fileName="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 199
    iget-object v5, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundPanel:Lcom/nemustech/regina/WallpaperPanel;

    const/4 v6, 0x0

    invoke-virtual {v5, v6, p1}, Lcom/nemustech/regina/WallpaperPanel;->setImageResource(ILjava/lang/String;)Lcom/nemustech/tiffany/world/TFError;

    .line 201
    const-string v5, ".png"

    const-string v6, "_4.png"

    invoke-virtual {p1, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v2

    .line 202
    .local v2, thumbFileName:Ljava/lang/String;
    sget-object v5, Lcom/nemustech/regina/RGWorkspace;->TAG:Ljava/lang/String;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "[setWallPaper()] thumb fileName="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 203
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 204
    .local v1, thumbFile:Ljava/io/File;
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v5

    if-nez v5, :cond_0

    .line 205
    sget-object v5, Lcom/nemustech/regina/RGWorkspace;->TAG:Ljava/lang/String;

    const-string v6, "No thumb file found, create one"

    invoke-static {v5, v6}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 206
    new-instance v0, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v0}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 207
    .local v0, opts:Landroid/graphics/BitmapFactory$Options;
    const/4 v5, 0x2

    iput v5, v0, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    .line 208
    const/4 v5, 0x0

    iput-boolean v5, v0, Landroid/graphics/BitmapFactory$Options;->inScaled:Z

    .line 209
    invoke-static {p1, v0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v3

    .line 210
    .local v3, thumbImage:Landroid/graphics/Bitmap;
    sget-object v5, Lcom/nemustech/regina/RGWorkspace;->TAG:Ljava/lang/String;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Bitmap:"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 211
    sget-object v5, Landroid/graphics/Bitmap$CompressFormat;->PNG:Landroid/graphics/Bitmap$CompressFormat;

    const/4 v6, 0x0

    invoke-static {v2, v3, v5, v6}, Lcom/nemustech/tiffany/world/TFUtils;->saveBitmapToFile(Ljava/lang/String;Landroid/graphics/Bitmap;Landroid/graphics/Bitmap$CompressFormat;I)Z

    .line 213
    .end local v0           #opts:Landroid/graphics/BitmapFactory$Options;
    .end local v3           #thumbImage:Landroid/graphics/Bitmap;
    :cond_0
    iget-object v5, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundThumbPanel:Lcom/nemustech/regina/WallpaperPanel;

    const/4 v6, 0x0

    invoke-virtual {v5, v6, v2}, Lcom/nemustech/regina/WallpaperPanel;->setImageResource(ILjava/lang/String;)Lcom/nemustech/tiffany/world/TFError;

    .line 224
    .end local v1           #thumbFile:Ljava/io/File;
    .end local v2           #thumbFileName:Ljava/lang/String;
    :goto_0
    monitor-exit v4

    .line 225
    return-void

    .line 217
    :cond_1
    iget-object v5, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundPanel:Lcom/nemustech/regina/WallpaperPanel;

    const/4 v6, 0x0

    iget-object v7, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v7}, Lcom/nemustech/regina/ReginaLauncher;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    const v8, 0x7f02007a

    invoke-virtual {v5, v6, v7, v8}, Lcom/nemustech/regina/WallpaperPanel;->setImageResource(ILandroid/content/res/Resources;I)Lcom/nemustech/tiffany/world/TFError;

    .line 218
    iget-object v5, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundThumbPanel:Lcom/nemustech/regina/WallpaperPanel;

    const/4 v6, 0x0

    iget-object v7, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v7}, Lcom/nemustech/regina/ReginaLauncher;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    const v8, 0x7f02007b

    invoke-virtual {v5, v6, v7, v8}, Lcom/nemustech/regina/WallpaperPanel;->setImageResource(ILandroid/content/res/Resources;I)Lcom/nemustech/tiffany/world/TFError;

    goto :goto_0

    .line 224
    :catchall_0
    move-exception v5

    monitor-exit v4
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v5

    .line 221
    :cond_2
    :try_start_1
    iget-object v5, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundPanel:Lcom/nemustech/regina/WallpaperPanel;

    const/4 v6, 0x0

    iget-object v7, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v7}, Lcom/nemustech/regina/ReginaLauncher;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    const v8, 0x7f02007a

    invoke-virtual {v5, v6, v7, v8}, Lcom/nemustech/regina/WallpaperPanel;->setImageResource(ILandroid/content/res/Resources;I)Lcom/nemustech/tiffany/world/TFError;

    .line 222
    iget-object v5, p0, Lcom/nemustech/regina/RGWorkspace;->mBackgroundThumbPanel:Lcom/nemustech/regina/WallpaperPanel;

    const/4 v6, 0x0

    iget-object v7, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v7}, Lcom/nemustech/regina/ReginaLauncher;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    const v8, 0x7f02007b

    invoke-virtual {v5, v6, v7, v8}, Lcom/nemustech/regina/WallpaperPanel;->setImageResource(ILandroid/content/res/Resources;I)Lcom/nemustech/tiffany/world/TFError;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0
.end method

.method public updateThumb(F)V
    .locals 5
    .parameter "scale"

    .prologue
    const/4 v4, 0x0

    const/4 v3, 0x0

    .line 590
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v0}, Lcom/nemustech/regina/ReginaLauncher;->isElementLoading()Z

    move-result v0

    if-nez v0, :cond_0

    .line 591
    sget-object v0, Lcom/nemustech/regina/RGWorkspace;->TAG:Ljava/lang/String;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "updateThumb called : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Lcom/nemustech/regina/RGWorkspace;->getItemIndex()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1, v3}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 592
    iget-object v0, p0, Lcom/nemustech/regina/RGWorkspace;->mElementPanel:Lcom/nemustech/tiffany/world/TFPanel;

    invoke-virtual {v0, v3, v4, v4}, Lcom/nemustech/tiffany/world/TFPanel;->setImageResource(ILandroid/graphics/Bitmap;Landroid/graphics/Rect;)Z

    .line 593
    iput-boolean v3, p0, Lcom/nemustech/regina/RGWorkspace;->mRequestUpdate:Z

    .line 595
    :cond_0
    return-void
.end method
